package com.appspot.categoryeditor.resource;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.StreamingOutput;

@Path("/categories")
public interface CategoriesResource {

	@GET
	@Path("{userId}")
	@Consumes(MediaType.APPLICATION_JSON)
	@Produces(MediaType.APPLICATION_JSON)
	public StreamingOutput getUserCategories(
			@Context HttpServletRequest req,
			@Context HttpServletResponse resp,
			@PathParam("userId") String userId);
	
	@GET
	@Path("{userId}")
	@Consumes(MediaType.TEXT_HTML)
	@Produces(MediaType.TEXT_HTML)
	public StreamingOutput getUserPage(
			@Context HttpServletRequest req,
			@Context HttpServletResponse resp,
			@PathParam("userId") String userId);	

	@GET
	@Path("{id}/categories/{categoryId}")
	@Consumes(MediaType.TEXT_HTML)
	@Produces(MediaType.TEXT_HTML)
	public Response getCategory(@Context HttpServletRequest req,
			@Context HttpServletResponse resp, @PathParam("id") String id,
			@PathParam("categoryId") String categoryId);

}
